<?php
class Friends extends Zend_Db_Table
{

	protected $_name = 'friends';

	protected $_primary = 'id';

	protected $_referenceMap = array (
								'User' => array (
								'columns' => array('friend_a_id'),
								'refTableClass' => 'User',
								'refColumns'  => array('id') 
								),
								'Wanna' => array (
								'columns' => array('friend_b_id'),
								'refTableClass' => 'Wanna',
								'refColumns'  => array('userID') 
								));
	/*
	 * ,
								'Glocation' => array (
								'columns' => array('friend_b_id'),
								'refTableClass' => 'Glocation',
	 							'refColumns'  => array('id')   
								)
	 */	
	function getFriendsWanna($user_name)
	{
		$users = new User();
		$friends = new Friends();
		$wanna = new Wanna();
		$specUser = $users->fetchRow('user_name = "'.$user_name.'"');
		$userrow = $specUser->findManyToManyRowset($wanna,$friends);	
		return $userrow;
	}			
}
?>